1. Field of the Invention
The present invention relates generally to computer systems that manage transactions and, more particularly, to such computer systems that manage nested atomic transactions.
2. Related Art
Management of storage resources is an essential aspect of implementing and maintaining a storage area network (SAN). Storage management can encompass a broad range of storage functions, including file access, volume management and data backup. Of particular interest, storage management includes the ability to dynamically allocate individual storage units, such as disks, to shared storage groups and/or specific storage servers (hosts). Dynamically allocating storage units is typically achieved through change commands issued by system administrators on one or more workstations having access to resources on the SAN via a local area network (LAN). Because a single change command issued on one of these workstations can cause a SAN management system to make several interrelated changes in the SAN and in a virtual representation of the SAN, a mechanism is needed to ensure that either all the changes are made or none of the changes is made, because if only some of the changes are made, the SAN or the virtual representation of the SAN can be left in an unstable state, possibly leading to data corruption.
A set of steps that are performed completely, or not at all, is commonly called an “atomic transaction.” Atomic transactions exhibit “transaction semantics,” that is, if an atomic transaction begins, but one or more of its steps fails, the successful steps are reversed. Stated another way, at the end of an atomic transaction, the system is in either: (a) a desired, final state attained by a successful completion of all the steps of the transaction or (b) the state the system was in before the transaction began.
Because a SAN management system performs atomic transactions, that is, makes a set of interrelated changes to a virtual representation of a SAN or to physical devices in the actual SAN in such a way that either all the changes are completed successfully or none of the changes is made, it is desirable to provide a mechanism for aggregating a set of change commands into an atomic transaction.
Atomic transactions are typically implemented using a so-called “two-phase commit sequence.” A set of preparatory steps is executed in a first (“prepare”) phase. These steps perform operations to ensure that the transaction can be completed successfully in the second phase. The prepare phase does not, however, complete the transaction. For example, the prepare phase can allocate resources, ensure the existing state of the system would not prevent successful completion of the transaction and temporarily block the system from changing state in a way that might interfere with successful completion of the transaction. All transaction steps that could possibly fail are performed in the prepare phase.
If all the steps of the prepare phase succeed, the system executes the second (“commit”) phase, which completes the transaction. For example, the commit phase might use the resources allocated during the prepare phase, make changes to state variables in the system, and then unblock the system from changing state. On the other hand, if any step of the prepare phase fails, the system executes a different second (“rollback”) phase. For example, the rollback phase might release the allocated resources without using them, and then unblock the system from changing state.
Many of the SAN change commands issued on a workstation implicitly involve aggregating several commands. Some of these commands might be themselves aggregations of other commands. Problematically, such “nested” atomic transactions are inefficient and complicated to implement using traditional approaches. It is, therefore, desirable to provide a simple and efficient mechanism for implementing nested atomic transactions.